//
//  ViewController.m
//  01-动态透明效果
//
//  Created by 啦啦啦 on 15/12/29.
//  Copyright © 2015年 啦啦啦. All rights reserved.
//

#import "ViewController.h"
#import "GYNavagation.h"

@interface ViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic, strong) GYNavagation *nav;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UITableView *tableview = [[UITableView alloc] initWithFrame:self.view.bounds];
    tableview.delegate = self;
    tableview.dataSource = self;
    [self.view addSubview:tableview];
    
    self.nav = (GYNavagation *)self.navigationController;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 30;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [[UITableViewCell alloc] init];
    cell.textLabel.text = @"gy";
    return cell;
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    CGFloat alph = scrollView.contentOffset.y/320;
    [self.nav setAlph:alph];
}

@end
